package edu.nf.llmtest.web;


import edu.nf.llmtest.common.VO.ResultVO;
import edu.nf.llmtest.common.base.BaseController;
import edu.nf.llmtest.model.entity.Conversations;
import edu.nf.llmtest.service.ConversationService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ Author bin
 * @ Create  2025/11/3 上午10:41
 * 对话接口
 **/
@RequestMapping("/llm")
@RestController
@RequiredArgsConstructor
@Slf4j
public class ConversationController extends BaseController {
    private final ConversationService conversationService;
    /**
     * 根据sessionId获取对话记录
     * */
    @GetMapping("/getConversation")
    public ResultVO<List<Conversations>> getConversation(@RequestParam String sessionId) {
        return success(conversationService.getConversation(sessionId));
    }
}
